Quantum neural network

ABSTRACT

A quantum neural network architecture. In one aspect, a quantum neural network trained to perform a machine learning task includes: an input quantum neural network layer comprising (i) multiple qubits prepared in an initial quantum state encoding a machine learning task data input, and (ii) a target qubit, a sequence of intermediate quantum neural network layers, each intermediate quantum neural network layer comprising multiple quantum logic gates that operate on the multiple qubits and target qubit; and an output quantum neural network layer comprising a measurement quantum gate that operates on the target qubit and provides as output data representing a solution to the machine learning task.

CROSS-REFERENCE TO RELATED APPLICATION

This is a continuation application of: and claims priority to, U.S. Pat. Application No. 16/618,713, now Patent No. 11,601,265 filed on Dec. 2, 2019. which application is a National Stage Application under 35 U.S.C. §371 and claims the benefit of International Application No. PCT/US2018/035665, filed Jun. 1, 2018, which claims the benefit under 35 U.S.C. § 119(e) of priority to U.S. Application No. 62/514.475, filed Jun. 2, 2017, the disclosures of which are incorporated herein by reference.

BACKGROUND

This specification relates to neural network architectures and quantum computing.

Neural networks are machine learning models that employ one or more layers of nonlinear units to predict an output for a received input. Some neural networks include one or more hidden layers in addition to an output layer. The output of each hidden layer is used as input to the next layer in the network. i.e.. the next hidden layer or the output layer. Each layer of the network generates an output from a received input in accordance with current values of a respective set of parameter.

SUMMARY

This specification describes a neural network architecture implemented by one or more quantum processors.

In general, one innovative aspect of the subject matter described in this specification can be embodied in a quantum neural network implemented by one or more quantum processors, the quantum neural network comprising: an input quantum neural network layer comprising (i) multiple qubits prepared in an initial quantum state and encoding a machine learning task data input, and (ii) a target qubit prepared in an initial state; a sequence of intermediate quantum neural network layers, each intermediate quantum neural network layer comprising multiple quantum logic gates that operate on the multiple qubits and target qubit; and an output quantum neural network layer comprising a measurement quantum gate that operates on the target qubit and provides, as output data representing a solution to a machine learning task for which the quantum neural network has been trained to perform,

Other embodiments of this aspect include corresponding computer systems, apparatus, and computer programs recorded on one or more computer storage devices. A system of one or most classical or quantum computers can be configured to perform particular operations or actions by virtue of software, firmware, hardware, or any combination thereof installed on the system that in operation may cause the system to perform the actions. One or more computer programs can be configured to perform particular operations or actions by virtue of including instructions that, when executed by data processing apparatus, cause the apparatus to perform the actions

The foregoing and other embodiments can each optionally include one or more of the following features, alone or in combination. In some implementations the machine learning task comprises a binary classification task.

In some implementations the machine learning task data input comprises a Boolean function input {0, 1 }^(n) and the solution to the machine learning task comprises a Boolean function output {0. 1 }.

In some implementations each intermediate quantum neural network layer comprises (i) single qubit quantum logic gates, (ii) two qubit quantum logic gates, or (iii) both single qubit and two qubit quantum logic gates.

In some implementations the single qubit quantum gates comprise single qubit gates of the form exp (-iθX_(j)).

In some implementations the two qubit quantum gates comprise two qubit gates of the form exp (iθZ_(j)Z_(k)).

In some implementations the sequence of intermediate quantum neural network layers maps the encoded machine learning task data input to an evolved state of the target qubit.

In some implementations mapping the encoded machine learning task data input to an evolved state of the target qubit comprises applying a unitary operator to the initial quantum states, the unitary operator being parameterized by quantum logic gate parameters for the quantum logic gates.

In some implementations preparing the multiple qubits in the initial state comprises setting a z-direction of each of the multiple qubits.

In some implementations the measurement quantum gate measures a y-direction of the target qubit.

In some implementations the quantum neural network replaces n top layers of a classical deep neural network trained to perform the machine learning task.

In some implementations the machine learning task data input comprises an output from the classical deep neural network.

In some implementations the multiple qubits and target qubit are arranged as a two dimensional grid with nearest neighbor interactions.

In general, another innovative aspect of the subject matter described in this specification can be embodied in a method for processing a data input using a quantum neural network that has been trained to perform a machine learning task, the method comprising: preparing, in an initial quantum state, multiple qubits of an input quantum neural network layer in an initial quantum state to encode machine learning task data input: processing the machine learning task data input using one or more intermediate quantum neural network layers, wherein each quantum neural network layer comprises multiple quantum logic gates that operate on the multiple qubits and a target qubit that is also in the input quantum neutral network layer, the processing comprising, for each intermediate quantum neural network layer and in a sequence, applying quantum logic gates for the intermediate quantum neural network layer to a current quantum state representing the multiple qubits and the target qubit; and measuring the target qubit by a measurement quantum gate in an output quantum neural network layer to generate an output representing a solution to the machine learning task.

Other embodiments of this aspect include corresponding computer systems, apparatus, and computer programs recorded on one or more computer storage devices, each configured to perform the actions of the methods. A system of one or more computers can be configured to perform particular operations or actions by virtue of software, firmware, hardware, or any combination thereof installed on the system that in operation may cause the system to perform the actions. One or more computer programs can be configured to perform particular operations or actions by virtue of including instructions that, when executed by data processing apparatus, cause the apparatus to perform the actions.

The foregoing and other embodiments can each optionally include one or more of the following features, alone or in combination. In some implementations the machine learning task comprises a binary classification task.

In some implementations the machine learning task data input comprises a Boolean function input {0, 1}^(n) and the solution to the machine learning task comprises a Boolean function output {0, i}.

In some implementations each intermediate quantum neural network layer comprises (i) single qubit quantum logic gates, (ii) two qubit quantum logic gates, or (iii) both single qubit and two qubit quantum logic gates.

In some implementations the single qubit quantum gates comprise single qubit gates of the form exp (-iθX_(j)).

In some implementations the two qubit quantum gates comprise two qubit gates of the form exp (iθZ_(j)Z_(k)).

In some implementations processing the data input using the sequence of intermediate quantum neural network layers comprises mapping the encoded machine learning task data input to an evolved state of the target qubit.

In some implementations mapping the encoded machine learning task data input to the evolved state of the target qubit comprises applying a unitary operator to the initial quantum states, the unitary operator being parameterized by quantum logic gate parameters for the quantum logic gates.

In some implementations encoding the data input into an initial quantum state of the multiple qubits comprises setting a x-direction of each of the multiple qubits.

In some implementations measuring the target qubit to generate an output representing a solution to the machine learning task comprises measuring a y-direction of the target qubit.

In general, another innovative aspect of the subject matter described in this specification can be embodied in a method for training a quantum neural network, the method comprising: obtaining multiple training examples, each training example comprising a machine learning task input paired with a known classification for the machine learning task input; and training the quantum neural network on the training examples, comprising, for each training example: preparing, in an initial quantum state, multiple qubits of an input quantum neural network layer in an initial quantum state to encode the machine learning task input: processing the machine learning task input using one or more intermediate quantum neural network layers, wherein each quantum neural network layer comprises multiple quantum logic gates that operate on the multiple qubits and a target qubit that is also in the input quantum neural network layer, the processing comprising, for each intermediate quantum neural network layer and in a sequence, applying quantum logic gates for the intermediate quantum neural network layer to a current quantum state representing the multiple qubits and the target qubit; measuring the target qubit by a measurement quantum gate in an output quantum neural network layer to generate an output representing a solution to the machine learning task: and comparing the generated output to the known classification to determine one or more gate parameter adjustments; and adjusting values of the gate parameters from initial values to trained values.

Other embodiments of this aspect include corresponding computer systems, apparatus, and computer programs recorded on one or more computer storage devices, each configured to perform the actions of the methods. A system of one or more computers can be configured to perform particular operations or actions by virtue of software, firmware, hardware, or any combination thereof installed on the system that in operation may cause the system to perform the actions. One or more computer programs can be configured to perform particular operations or actions by virtue of including instructions that, when executed by data processing apparatus, cause the apparatus to perform the actions.

The foregoing and other embodiments can each optionally include one or more of the following features, alone or in combination. In some implementations comparing the generated output to the known classification to determine one or more gate parameter adjustments comprises: calculating a loss function using the generated output and the known classification for the machine learning task: and performing gradient descent to determine adjusted values of the gate parameters.

In some implementations the method further comprises performing regularization after processing a subset of training examples.

In some implementations regularization comprises zero-norm or one-norm regularization.

In some implementations training the quantum neural network to perform the machine learning task comprises training the quantum neural network to learn a Boolean function f : (0,1}^(n) → {0,1}.

In some implementations the loss function is given by Loss(s, θ) = (〈φ(θ,z_(s))|σ_(y) _(out)|ψ(θ,z₃)〉 - y₅)² where θ represents the quantum gate parameters, ψ(θ,z_(s)) represents an evolved quantum state of the multiple qubits and target qubit, σ_(y) _(out) represents the measurement quantum gate, and y_(s) represents the known classification.

In some implementations the Boolean function comprises a parity function, subset parity function, subset majority function or logical AND function.

The subject matter described in this specification can be implemented in particular embodiments so as to realize one or more of the following advantages.

The presently described disclosure represents a significant and widely applicable improvement to the state of the art in classical and quantum neural networks.

A quantum neural network, as described in this specification, may perform machine learning tasks with lower time complexity compared to other known classical or quantum neural networks. For example, the quantum neural network described in this specification may be used to perform factoring tasks by casting the factoring tasks as decision tasks and performing the decision tasks using the quantum neural network. The time complexity may be lower since the difference between the number of neural network layers needed to perform the factorization using known neural networks and the presently described quantum neural network may increase exponentially with respect to the length of the number to be factored.

A quantum neural network, as described in this specification, may perform machine learning tasks with lower sample complexity compared to other known classical or quantum neural networks. For example the presently described quantum neural network may learn machine learning tasks with polynomial sample complexity, compared to other neural networks that learn the same machine learning tasks with exponential sample complexity.

A quantum neural network, as described in this specification, may also achieve higher expressivity (the measure of how the structural properties of a neural network affect the functions it is able to compute) compared to other known classical or quantum neural networks. For example, the Vapnik Chernovenkis dimension may be larger for the presently described quantum neural network compared to other neural networks, e.g., convolutional neural networks.

A quantum neural network, as described in this specification, may achieve higher robustness to label noise compared to other known classical or quantum neural networks. For example, the presently described quantum neural network may achieve higher robustness to label noise when learning parity tasks.

Due to the specific architecture of the presently described quantum neural network, the quantum neural network described in this specification may be trained to perform machine learning tasks without the use of backpropagation techniques. This can streamline the training process and reduce the processing time and costs needed to train the quantum neutral network. For example, notorious downsides to the use of backpropagation techniques, e.g., the incurrence of practical instabilities in the learning process due to vanishing and exploding gradients or the ditticulties in parallelizing large neural networks due to the sequential nature of backpropagation, can be avoided.

A quantum neural network, as described in this specification, may be combined with classical neural networks. Replacing layers of a classical neural network with the presently described quantum neural network may improve the accuracy and time in which the neural network can be trained and used at inference, i.e., compared to using just a classical neural network. Conversely, performing some pre-computations using a classical neural network to generate a processed input for the presently described quantum neural network can reduce the computational costs and resources required when training and using the quantum neural network, i.e., compared to using just a quantum neural network.

The details of one or more embodiments of the subject matter of this specification are set forth in the accompanying drawings and the description below. Other features, aspects, and advantages of the subject matter will become apparent from the description, the drawings, and the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of an example quantum neural network architecture.

FIG. 2 is a flow diagram of an example process for training a quantum neural network.

FIG. 3 is a flow diagram of an example process for processing a data input using a quantum neural network that has been trained to perform a machine learning task.

Like reference numbers and designations in the various drawings indicate like elements.

DETAILED DESCRIPTION

This specification describes a neural network architecture implemented by one or more quantum processors. The neural network, hereafter called a quantum neural network (QNN), can be trained to perform a machine learning task, e.g., a binary classification task. For example, the QNN may be trained to learn a Boolean function ƒ:{0,1}^(n) → {0,1}, e.g., a parity function, subset parity function, or subset majority function. In these examples the machine learning task data input includes a Boolean function input {0,1}^(n). The solution to the machine learning task includes a Boolean function output {0,1}.

Example Hardware

FIG. 1 shows an example quantum neural network architecture 100 for performing machine learning tasks. The quantum neural network architecture 100 is an example is an example of a system implemented as classical or quantum computer programs on one or more classical computers or quantum computing devices in one or more locations, in which the systems, components, and techniques described below can be implemented.

The quantum neural network architecture 100 includes a quantum neural network 102. The quantum neural network 102 is configured to receive as input machine learning task input data. e.g., input data 150, and to process the received input data to generate as output data representing a solution to the machine learning task. e.g., output data 152. Data inputs can be received during training or when performing machine learning tasks, i.e., the data inputs may represent training examples or runtime inputs. For example, the quantum neural network 102 may receive data inputs from a set of training data during training, or may receive data inputs from a user device during an inferential machine learning process. An example process for training a quantum neural network is described in detail below with reference to FIG. 2 . An example inferential machine learning process is described in detail below with reference to FIG. 3 .

The quantum neural network 102 includes an input quantum neural network layer 104, a sequence of intermediate quantum neural network layers 106 a-106 e, and an output quantum neural network layer 108. For convenience, the example quantum neural network 102 is illustrated as including five intermediate quantum neural network layers 106 a-106 e, however in some implementations the quantum neural network may include fewer or more layers. The number of layers may depend on the complexity of the machine learning task that the quantum neural network is trained to perform and/or the target accuracy of solutions generated by the quantum neural network.

The input quantum neural network layer 104 includes a plurality of qubits 110, e.g., arranged as a two-dimensional grid with nearest neighbor interactions. The type of physical realizations of qubits included in the input quantum neural network layer may vary. For example, in some implementations the input quantum neural network layer 104 may include superconducting qubits, e.g., superconducting charge qubits, superconducting flux qubits or superconducting phase qubits. In other implementations the input quantum neural network layer 104 may include qubits realized by spins. e.g., electron spins, nuclear spins or atomic spins.

The plurality of qubits 110 includes multiple qubits that are prepared in an initial quantum state that encoded the machine learning task data input 150. For example, one or more control devices 114 may encode a machine learning task data input into an initial quantum state of the multiple qubits by setting the z-directions of each of the qubits. For example, in cases where the data input includes a binary string of length n, the system may set the z directions of n qubits corresponding to each binary digit to zero or one, wherein zero identities with a zero computational basis state |0〉 and one identifies with a one computational basis state |1〉. The plurality of qubits also includes a target qubit that is prepared in an initial state, e.g., an arbitrary superposition state.

Each of the intermediate quantum neural network layers 106 a-106 e includes multiple quantum logic gates that operate on the plurality of qubits 110 (i.e., the multiple qubits prepared in the initial state encoding the machine learning task data input and the target qubit.) The quantum logic gates included in each intermediate quantum neural network layer may include single qubit quantum logic gates, two qubit quantum logic gates, or both single qubit and two qubit quantum logic gates. For example, in the example quantum neural network 100 the first intermediate quantum neural network layer 106 a includes multiple single qubit gates, e.g., single qubit gate 112, that operate on each of the plurality of qubits 110. The subsequent intermediate quantum neural network layers 106 b - 108 e include two qubit gates, e.g., two qubit gate 118. In some implementations the single qubit quantum gates may include single qubit gates of the form exp (-iθ_(j)X_(j)) where θ_(j) represents gate parameters and X_(j) represents a Pauli X operator. In some implementations the two qubit quantum gates may include two qubit gates of the form exp (iθZ_(j)Z_(k)), where Z_(j) represents a Pauli Z operator, or any other product of two Pauli operators.

The sequence of intermediate quantum neural network layers 106 a-106 e operate on the plurality of qubits 110, evolving a quantum state describing the plurality of qubits 110 to an evolved quantum state. The evolved quantum state encodes the solution to the machine learning task. More specifically, the sequence of quantum neural network layers 104, 106 a-106 e map the initial quantum state encoding the machine learning task data input 150 to an evolved state of the target qubit encoding the solution to the machine learning task,

The output quantum neural network layer 108 that includes multiple measurement quantum gates, e.g., measurement gate 120, that operates on the target qubit and provides as output a measurement result representing a solution to the machine learning task, For example, the measurement quantum gate 120 may be a gate that measures a y-direction of the target qubit to obtain the solution to the machine learning task. The location of the target qubit may vary, and FIG. 1 shows one of multiple possible locations.

The quantum neural network architecture 100 may include one or more control devices 114 and one or more classical processors 116. The control devices 114 include devices that are configured to operate on the quantum neural network 102 and the components therein. For example, the control devices 110 may include hardware used for initializing the plurality of qubits. e.g., control lines coupled to the plurality of qubits that run excitation pulses that allow the state of the qubits to be controlled. The control devices 110 may further include hardware used for controlling the quantum logic gates that are applied to the plurality of qubits, e.g.. hardware used to set or adjust the values of the quantum logic gate parameters. In some implementations the control devices may include microwave control devices.

The classical processors 116 may be configured to perform classical operations. For example, the classical processors 116 may perform pre-processing of input data or post-processing of output data. For example, the classical processors 116 may receive output data representing a solution to a machine learning task from the quantum neural network 102 and process the received data to generate a data output that can be provided for display to an operator of the system 100.

In some implementations the quantum neural network 100 may be used in conjunction with a classical deep neural network implemented by the classical processors 116. For example, the quantum neural network 100 may replace a top (final) n layers of a classical deep neural network that has been trained to perform the machine learning task, In these examples, the machine learning task data input received by the quantum neural network includes an output from a (new) top layer in the classical deep neural network.

Programming the Hardware

FIG. 2 is a flow diagram of an example process 200 for training a quantum neural network to perform a classification task. For example, the example process may be used to train the quantum neural network l(K) described above with reference to FIG. 1 . For convenience, the process 200 will be described as being performed by a system of one or more classical and/or quantum computers located in one or more locations.

The system obtains multiple training examples, each training example including a machine learning task input paired with a known classification for the machine learning task input (step 202). For example, in cases where the quantum neural network is trained to learn a Boolean function, the training examples may include {z_(s),y = f(z)}_(s=1,...s), where Z₅ represents the machine learning task input and y_(s) represents the known classification for the input.

The system trains the quantum neural network on the training examples to adjust the values of the gate parameters from initial values to trained values (step 204). To train the quantum neural network on a training example the system prepares multiple qubits of an input quantum neural network layer in an initial quantum state to encode the machine learning task input in the initial quantum state (step 204 a). The system then processes the machine learning task input using one or more intermediate quantum neural network layers (step 204 b). Each quantum neural network layer includes multiple quantum logic gates that operate on the multiple qubits and a target qubit that is also in the input quantum neural network layer. Processing the machine learning task input using one or more intermediate quantum neural network layers may therefore include, for each intermediate quantum neural network layer and in a sequence, applying quantum logic gates for the intermediate quantum neural network layer to a current quantum state representing the multiple qubits and the target qubit. The system then measures the target qubit by applying a measurement quantum gate to the target qubit in an output quantum neural network layer to generate an output representing a solution to the machine learning task (step 204 c).

The system compares the generated output to the known classification to determine one or more gate parameter adjustments (step 204 d). Comparing the generated output to the known classification may include calculating functions. e.g., loss functions, using the generated output and the known classification. The functions can depend on the evolved quantum state of the multiple qubits and target qubit which, in turn, depends on the quantum gate parameters of the single and two qubit quantum logic gates included in the one or more intermediate quantum neural network layers. For example, in cases where the quantum neural network is trained to learn a Boolean function f: {0, 1}^(n) → {0,1}, e.g.. a parity function, subset parity function, subset majority function or logical AND function, a loss function may be given by

Loss(s, θ) = (⟨ψ(θ, z_(s))|σ_(y out)|ψ(θ, z_(s))⟩ − y_(s))²

where θ represents the quantum gate parameters, ψ(θ, z_(s)) represents an evolved quantum state of the multiple qubits and target qubit, σ_(y) _(out) represents the measurement quantum gate, and y₃ represents the known classification. Gradient descent, e.g., stochastic gradient descent, may then be performed on the loss function to determine adjusted values of the gate parameters.

Due to the particular architecture of the quantum neural network, backpropagation techniques are not required to determine the one or more parameter adjustments. This is because by construction of the input quantum neural network layer, intermediate quantum neural network layers, and output quantum neural network layer, and functions of the evolved quantum state that are used to compare the generated output to the known classification, are dependent on the quantum logic gate parameters for quantum logic gates included in the intermediate quantum neural network layers - not just the quantum logic gate parameters included in the output quantum neural network layer. In other words, unlike conventional neural networks, the action of applying multiple intermediate quantum neural network layers to an input quantum neural network layer output is equivalent to evolving the initial state of qubits included in the input quantum neural network layer under a sequence of unitary operators that is parameterized by the quantum logic gate parameters for the quantum logic gates included in the multiple intermediate quantum neural network layers. By contrast, conventional neural networks can be thought of as highly nested functions of their parameters. The evolved initial state is therefore dependent on all the quantum logic gate parameters. Therefore, only one gradient descent or other optimization routine needs to be performed to determine parameter adjustments for all the quantum logic gate parameters (i.e., parameter adjustments for all the intermediate quantum neural network layers) when performing an optimization on functions of the evolved quantum state.

The system then adjusts values of the gate parameters from initial values to trained values (step 204e).

In some implementations the system may perform regularization techniques after processing a subset of the training examples, e.g., after processing 100 training examples. Regularization techniques include zero-norm or one-norm regularization. For example, after processing a subset of training examples, the quantum gate parameters θ may be monitored to determine whether any parameters are close to zero. If a parameter is close to zero, the gate may be adjusted, e.g., by replacing a Z gate with a Y gate, so that learning can be recycled.

FIG. 3 is a flow diagram of an example process 300 for processing a data input using a quantum neural network that has been trained to perform a machine learning task. For example, the example process 300 may be used for processing a data input using the quantum neural network 100 of FIG. 1 that has been trained to perform a machine learning task using the process 200 of FIG. 2 . For convenience, the process 300 will be described as being performed by a system of one or more classical and/or quantum computers located in one or more locations.

The system prepares multiple qubits of an input quantum neural network layer in an initial quantum state to encode the data input into the initial quantum state (step 302). For example, the system may encode the data input into the initial quantum state by setting a z-direction of each of the multiple qubits of the input quantum neural network layer. Preparing the multiple qubits of the input quantum neural network layer also includes preparing a target qubit included in the input quantum neural network layer in an initial state, e.g., in a

$\frac{1}{\sqrt{}}$

(|0) + |1〉) superposition state.

The system processes the data input using one or more intermediate quantum neural network layers that each include multiple quantum logic gates that operate on the multiple qubits and the target qubit (step 304). Each intermediate quantum neural network layer includes single qubit quantum logic gates, e.g., single qubit gates of the form exp (-1θX_(j)), two qubit quantum logic gates. e.g., two qubit gates of the form exp (1θZ_(j)Z_(k)), or both single qubit and two qubit quantum logic gates, that operate on the qubits included in the intermediate quantum neural network layers. Processing the data input using the one or more intermediate quantum neural network layers therefore includes, for each intermediate quantum neural network layer and in sequence, applying quantum logic gates for the intermediate quantum neural network layer to a current quantum state representing the multiple qubits and the target qubit.

Processing the data input using the one or more intermediate quantum neural network layers in this manner maps the encoded data input to an evolved state of the target qubit. That is, the encoded data input is mapped to an evolved state of the target qubit through application of a unitary operator to the initial quantum state. The unitary operator is parameterized by the single and two qubit quantum logic gate parameters for quantum logic gates included in the intermediate quantum neural network layers.

The system measures the target qubit to generate an output representing a solution to the machine learning task (step 306). For example, in cases where the machine learning task is a binary classification task and the data input encoded into the initial quantum state at step 302 is a Boolean function input {0, 1}^(n), the generated output representing a solution to the machine learning task may include a Boolean function output {0,1}. Measuring the target qubit may include measuring a y-direction of the target qubit.

Implementations of the digital and/or quantum subject matter and the digital functional operations and quantum operations described in this specification can be implemented in digital electronic circuitry, suitable quantum circuitry or, more generally, quantum computational systems, in tangibly-embodied digital and/or quantum computer software or firmware, in digital and/or quantum computer hardware, including the structures disclosed in this specification and their structural equivalents, or in combinations of one or more of them. The term “quantum computational systems” may include, but is not limited to, quantoin computers, quantum information processing systems, quantum cryptography systems, or quantum simulators.

implementations of the digital and/or quantum subject matter described in this specification can be implemented as one or more digital and/or quantum computer programs, i.e.. one or more modules of digital and/or quantion computer program instructions encoded on a tangible non-transitory storage medium for execution by, or to control the operation of, data processing apparatus. The digital and/or quantum computer storage medium can be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, one or more qubits, or a combination of one or more of them. Alternatively or in addition, the program instructions can be encoded on an artificially-generated propagated signal that is capable of encoding digital and/or quantum information, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode digital and/or quantum information for transmission to suitable receiver apparatus for execution by a data processing apparatus.

The terms quantum information and quantum data refer to information or data that is carried by, held or stored in quantum systems, where the smallest non-trivial system is a qubit, i.e., a system that defines the unit of quantum information. It is understood that the term “qubit” encompasses all quantum systems that may be suitably approximated as a two-level system in the corresponding context. Such quantum systems may include multi-level systems, e.g., with two or more levels. By way of example, such systems can include atoms, electrons, photons, ions or superconducting quibits. In many implementations the computational basis states are identified with the ground and first excited states, however it is understood that other setups where the computational states are identified with higher level excited states are possible.

The term “data processing apparatus” refers to digital and/or quantum data processing hardware and encompasses all kinds of apparatus, devices, and machines for processing digital and/or quantum data, including by way of example a programmable digital processor, a programmable quantum processor, a digital computer, a quantum computer, multiple digital and quantum processors or computers, and combinations thereof. The apparatus can also be, or further include, special purpose logic circuitry, e.g.. an FPGA (field programmable gate array), an ASIC (application-specific integrated circuit), or a quantum simulator, i.e.. a quantum data processing apparatus that is designed to simulate or produce information about a specific quantum system. In particular, a quantum simulator is a special purpose quantum computer that does not have the capability to perform universal quantum computation. The apparatus can optionally include, in addition to hardware, code that creates an execution environment for digital and/or quantum computer programs, e.g., code that constitutes processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them.

A digital computer program, which may also be referred to or described as a program, software, a software application, a module, a software module, a script, or code, can be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a digital computing environment. A quantum computer program, which may also be referred to or described as a program, software, a software application, a module, a software module, a script, or code, can be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, and translated into a suitable quantum programming language, or can be written in a quantum programming language, e.g., QCL or Quipper.

A digital and/or quantum computer program may, but need not, correspond to a file in a file system. A program can be stored in a portion of a file that holds other programs or data, e.g., one or more scripts stored in a markup language document, in a single file dedicated to the program in question, or in multiple coordinated tiles, e.g., files that store one or more modules, sub-programs, or portions of code. A digital and/or quantum computer program can be deployed to be executed on one digital or one quantum computer or on multiple digital and/or quantum computers that are located at one site or distributed across multiple sites and interconnected by a digital and/or quantum data communication network. A quantum data communication network is understood to be a network that may transmit quantum data using quantum systems, e.g. qubits. Generally, a digital data communication network cannot transmit quantum data, however a quantum data communication network may transmit both quantum data and digital data.

The processes and logic flows described in this specification can be performed by one or more programmable digital and/or quantum computers, operating with one or more digital and/or quantum processors, as appropriate, executing one or more digital and/or quantum computer programs to perform functions by operating on input digital and quantum data and generating output. The processes and logic flows can also be performed by, and apparatus can also be implemented as, special purpose logic circuitry, e.g.. an FPGA or an ASIC, or a quantum simulator, or by a combination of special purpose logic circuitry or quantum simulators and one or more programmed digital and/or quantum computers.

For a system of one or more digital and/or quantum computers to be “configured to” perform particular operations or actions means that the system has installed on it software, firmware, hardware, or a combination of them that in operation cause the system to perform the operations or actions. For one or more digital and/or quantum computer programs to be contigured to perform particular operations or actions means that the one or more programs include instructions that, when executed by digital and/or quantum data processing apparatus, cause the apparatus to perform the operations or actions. A quantum computer may receive instructions from a digital computer that, when executed by the quantum computing apparatus, cause the apparatus to perform the operations or actions.

Digital and/or quantum computers suitable for the execution of a digital and/or quantum computer program can be based on general or special purpose digital and/or quantum processors or both, or any other kind of central digital and/or quantum processing unit. Generally, a central digital and/or quantum processing unit will receive instructions and digital and/or quantum data from a read-only memory, a random access memory, or quantum systems suitable for transmitting quantum data, e.g. photons, or combinations thereof.

The essential elements of a digital and/or quantum computer are a central processing unit for performing or executing instructions and one or more memory devices for storing instructions and digital and/or quantum data. The central processing unit and the memory can be supplemented by, or incorporated in, special purpose logic circuitry or quantum simulators. Generally, a digital and/or quantum computer will also include, or be operatively coupled to receive digital and/or quantum data from or transfer digital and/or quantum data to, or both, one or more mass storage devices for storing digital and/or quantum data, e.g., magnetic, magneto-optical disks, optical disks, or quantum systems suitable for storing quantum information. However, a digital and/or quantum computer need not have such devices.

Digital and/or quantum computer-readable media suitable for storing digital and/or quantum computer program instructions and digital and/or quantum data include all forms of non-volatile digital and/or quantum memory, media and memory devices, including by way of example semiconductor memory devices, e.g.. EPROM, EEPROM, and flash memory devices; magnetic disks, e.g.. internal hard disks or removable disks; magneto-optical disks; CD-ROM and DVD-ROM disks: and quantum systems, e.g., trapped atoms or electrons. It is understood that quantum memories are devices that can store quantum data for a long time with high fidelity and efficiency, e.g., light-matter interfaces where light is used for transmission and matter for storing and preserving the quantum features of quantum data such as superposition or quantum coherence.

Control of the various systems described in this specification, or portions of them, can be implemented in a digital and/or quantum computer program product that includes instructions that are stored on one or more non-transitory machine-readable storage media, and that are executable on one or more digital and/or quantum processing devices. The systems described in this specification, or portions of them, can each be implemented as an apparatus, method, or system that may include one or more digital and/or quantum processing devices and memory to store executable instructions to perform the operations described in this specification.

While this specification contains many specific implementation details, these should not be construed as limitations on the scope of what may be claimed, but rather as descriptions of features that may be specific to particular implementations. Certain features that are described in this specification in the context of separate implementations can also be implemented in combination in a single implementation. Conversely, various features that are described in the context of a single implementation can also be implemented in multiple implementations separately or in any suitable sub-combination. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a sub-combination or variation of a sub-combination.

Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the implementations described above should not be understood as requiring such separation in all implementations, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.

Particular implementations of the subject matter have been described. Other implementations are within the scope of the following claims. For example, the actions recited in the claims can be performed in a different order and still achieve desirable results. As one example, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. 

1. (canceled)
 2. A method for training a quantum neural network to perform a machine learning task, the method comprising: training the quantum neural network on multiple training examples, each training example comprising a machine learning task input paired with a known classification for the machine learning task input, the training comprising, for each training example: encoding the machine learning task input into an initial quantum state of multiple qubits of an input quantum neural network layer; processing the machine learning task input using one or more intermediate quantum neural network layers, wherein each intermediate quantum neural network layer comprises multiple quantum logic gates that operate on the multiple qubits and a target qubit that is also in the input quantum neural network layer, the processing comprising, for each intermediate quantum neural network layer and in a sequence, applying quantum logic gates for the intermediate quantum neural network layer to a current quantum state representing the multiple qubits and the target qubit; measuring the target qubit in an output quantum neural network layer to obtain an output that represents a solution to the machine learning task, wherein the output comprises a measurement result that depends on an evolved quantum state of the multiple qubits and target qubit, wherein the evolved quantum state depends on the multiple quantum logic gates that operate on the multiple qubits and target qubit in each intermediate quantum neural network layer; comparing the output to the known classification to determine one or more gate parameter adjustments; and adjusting values of the gate parameters from initial values to trained values according to the one or more gate parameter adjustments.
 3. The method of claim 2, wherein each intermediate quantum neural network layer comprises (i) single qubit quantum logic gates, (ii) two qubit quantum logic gates, or (iii) both single qubit and two qubit quantum logic gates.
 4. The method of claim 3, wherein the single qubit quantum gates comprise single qubit gates of the form exp (-iθX_(i)).
 5. The method of claim 3, wherein the two qubit quantum gates comprise two qubit gates of the form exp (iθZ_(i)Z_(k)).
 6. The method of claim 2, wherein processing the machine learning task input using the one or more intermediate quantum neural network layers comprises mapping the encoded machine learning task input to an evolved state of the target qubit.
 7. The method of claim 6, wherein mapping the encoded machine learning task input to the evolved state of the target qubit comprises applying a unitary operator to the initial quantum state, the unitary operator being parameterized by quantum logic gate parameters for the quantum logic gates.
 8. The method of claim 2, wherein encoding the machine learning task input into an initial quantum state of the multiple qubits comprises setting a z-direction of each of the multiple qubits.
 9. The method of claim 2, wherein measuring the target qubit to obtain an output that represents a solution to the machine learning task comprises measuring a y-direction of the target qubit.
 10. The method of claim 2, wherein comparing the output to the known classification to determine one or more gate parameter adjustments comprises: calculating a loss function using the output and the known classification for the machine learning task; and performing gradient descent to determine adjusted values of the gate parameters.
 11. The method of claim 10, wherein the loss function is dependent on an evolved state of the multiple qubits and target qubit, wherein the evolved state is dependent on gate parameters for the quantum logic gates for each of the intermediate quantum neural network layers.
 12. The method of claim 10, wherein the loss function is given by Loss(s, θ) = ((ψ(θ, z_(s))|σ_(y out)|ψ(θ, z_(s))) − y_(s))² where θ represents quantum gate parameters, ψ(θ,z _(s)) represents an evolved quantum state of the multiple qubits and target qubit, σ_(y) _(out) represents a measurement quantum gate, and y_(s) represents the known classification.
 13. The method of claim 2, further comprising performing regularization after processing a subset of training examples, wherein regularization comprises zero-norm or one-norm regularization.
 14. The method of claim 2, wherein the machine learning task comprises a binary classification task, the machine learning task input comprises a Boolean function input {0, 1}”, and the solution to the machine learning task comprises a Boolean function output {0, 1}.
 15. The method of claim 2, wherein the Boolean function input comprises a parity function input, subset parity function input, subset majority function input or logical AND function input.
 16. An apparatus comprising: a quantum neural network implemented by one or more quantum processors; and a classical processor in data communication with the quantum neural network; wherein the apparatus is configured to perform operations for training the quantum neural network to perform a machine learning task, the operations comprising: training the quantum neural network on multiple training examples, each training example comprising a machine learning task input paired with a known classification for the machine learning task input, the training comprising, for each training example: encoding the machine learning task input into an initial quantum state of multiple qubits of an input quantum neural network layer; processing the machine learning task input using one or more intermediate quantum neural network layers, wherein each intermediate quantum neural network layer comprises multiple quantum logic gates that operate on the multiple qubits and a target qubit that is also in the input quantum neural network layer, the processing comprising, for each intermediate quantum neural network layer and in a sequence, applying quantum logic gates for the intermediate quantum neural network layer to a current quantum state representing the multiple qubits and the target qubit; measuring the target qubit in an output quantum neural network layer to obtain an output that represents a solution to the machine learning task, wherein the output comprises a measurement result that depends on an evolved quantum state of the multiple qubits and target qubit, wherein the evolved quantum state depends on the multiple quantum logic gates that operate on the multiple qubits and target qubit in each intermediate quantum neural network layer; comparing the output to the known classification to determine one or more gate parameter adjustments; and adjusting values of the gate parameters from initial values to trained values according to the one or more gate parameter adjustments.
 17. The apparatus of claim 16, wherein each intermediate quantum neural network layer comprises (i) single qubit quantum logic gates, (ii) two qubit quantum logic gates, or (iii) both single qubit and two qubit quantum logic gates.
 18. The apparatus of claim 17, wherein the single qubit quantum gates comprise single qubit gates of the form exp (-iθX_(i)).
 19. The apparatus of claim 17, wherein the two qubit quantum gates comprise two qubit gates of the form exp (iθZ_(i)Z_(k)).
 20. The apparatus of claim 16, wherein processing the machine learning task input using the one or more intermediate quantum neural network layers comprises mapping the encoded machine learning task input to an evolved state of the target qubit.
 21. The apparatus of claim 20, wherein mapping the encoded machine learning task input to the evolved state of the target qubit comprises applying a unitary operator to the initial quantum state, the unitary operator being parameterized by quantum logic gate parameters for the quantum logic gates. 